package com.neoCalf.neoCommon.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;


/**
 * Description 消息暂存表
 * date 2024-10-06 11:39:18
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("chat_message")
public class ChatMessage implements Serializable {
    /**
     * 消息ID
     */
    @TableId(value = "message_id")
    private Long messageId;
    /**
     * 会话ID
     */
    private String sessionId;
    /**
     * 消息类型
     */
    private Integer messageType;
    /**
     * 消息内容
     */
    private String messageContent;
    /**
     * 发送人ID
     */
    private String sendUserId;
    /**
     * 发送人昵称
     */
    private String sendUserNickName;
    /**
     * 发送时间
     */
    private Long sendTime;
    /**
     * 接受联系人ID
     */
    private String contactId;
    /**
     * 联系人类型 0：单聊 1： 群聊
     */
    private Integer contactType;
    /**
     * 文件大小
     */
    private Long fileSize;
    /**
     * 文件名
     */
    private String fileName;
    /**
     * 文件类型
     */
    private Integer fileType;
    /**
     * 文件路径
     */
    private Integer filePath;
    /**
     * 状态 0：正在发送 1：已发送 2: 发送失败
     */
    private Integer status;
    /**
     * 失败原因
     */
    @TableField(exist = false)
    private Integer failReason;

    public ChatMessage(Long messageId, String sessionId, Integer messageType, String messageContent, String sendUserId, String sendUserNickName, Long sendTime, String contactId, Integer contactType, Integer status) {
        this.messageId = messageId;
        this.sessionId = sessionId;
        this.messageType = messageType;
        this.messageContent = messageContent;
        this.sendUserId = sendUserId;
        this.sendUserNickName = sendUserNickName;
        this.sendTime = sendTime;
        this.contactId = contactId;
        this.contactType = contactType;
        this.status = status;
    }
}